package com.huirui.server.pojo.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.huirui.server.constant.OrderStatus;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 订单详情视图对象
 * 用于展示订单的详细信息，包括订单基本信息和关联的商品列表
 */
@Data
@Schema(description = "订单详情视图对象，包含订单基本信息及商品列表")
public class OrderDetailVo {

    @Schema(description = "订单ID", example = "10086", type = "Long")
    private Long orderId;

    @Schema(description = "订单状态", example = "PENDING_PAYMENT",
            implementation = OrderStatus.class,
            allowableValues = {"PENDING_PAYMENT", "PENDING_DELIVERY", "PENDING_RECEIPT", "COMPLETED", "CANCELED", "AFTER_SALES"})
    private OrderStatus status;

    @Schema(description = "收货人姓名", example = "张三")
    private String receiverName;

    @Schema(description = "收货人电话", example = "13800138000")
    private String receiverPhone;

    @Schema(description = "收货人地址", example = "北京市朝阳区某某街道123号")
    private String receiverAddress;

    @Schema(description = "订单总金额（元）", example = "99.99")
    private String price;

    @Schema(description = "订单编号", example = "ORD202510010001")
    private String orderNumber;

    @Schema(description = "下单时间", example = "2025-10-01T10:30:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime orderTime;

    @Schema(description = "订单付款时间", example = "2023-10-15T18:30:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime paymentTime;

    @Schema(description = "订单发货时间", example = "2023-10-15T18:30:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime shipmentTime;

    @Schema(description = "订单成交时间", example = "2023-10-15T18:30:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime transactionTime;

    @Schema(description = "订单取消时间", example = "2023-10-15T18:30:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime cancelTime;


    @Schema(description = "订单备注", example = "请尽快发货，谢谢", nullable = true)
    private String orderNote;

    @Schema(description = "订单包含的商品列表")
    private List<OrderResponseProductVo> orderList;
}

